Optimal. Leaf size=164 \[ -\frac {(A+7 i B) c^4 x}{a^3}-\frac {(i A-7 B) c^4 \log (\cos (e+f x))}{a^3 f}+\frac {8 (A+i B) c^4}{3 a^3 f (i-\tan (e+f x))^3}+\frac {2 (3 i A-5 B) c^4}{a^3 f (i-\tan (e+f x))^2}-\frac {6 (A+3 i B) c^4}{a^3 f (i-\tan (e+f x))}+\frac {i B c^4 \tan (e+f x)}{a^3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 164, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} -\frac {6 c^4 (A+3 i B)}{a^3 f (-\tan (e+f x)+i)}+\frac {2 c^4 (-5 B+3 i A)}{a^3 f (-\tan (e+f x)+i)^2}+\frac {8 c^4 (A+i B)}{3 a^3 f (-\tan (e+f x)+i)^3}-\frac {c^4 (-7 B+i A) \log (\cos (e+f x))}{a^3 f}-\frac {c^4 x (A+7 i B)}{a^3}+\frac {i B c^4 \tan (e+f x)}{a^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^3}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {i B c^3}{a^4}+\frac {8 (A+i B) c^3}{a^4 (-i+x)^4}+\frac {4 (-3 i A+5 B) c^3}{a^4 (-i+x)^3}-\frac {6 (A+3 i B) c^3}{a^4 (-i+x)^2}+\frac {i (A+7 i B) c^3}{a^4 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {(A+7 i B) c^4 x}{a^3}-\frac {(i A-7 B) c^4 \log (\cos (e+f x))}{a^3 f}+\frac {8 (A+i B) c^4}{3 a^3 f (i-\tan (e+f x))^3}+\frac {2 (3 i A-5 B) c^4}{a^3 f (i-\tan (e+f x))^2}-\frac {6 (A+3 i B) c^4}{a^3 f (i-\tan (e+f x))}+\frac {i B c^4 \tan (e+f x)}{a^3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 7.07, size = 319, normalized size = 1.95 \begin {gather*} \frac {c^4 \sec ^2(e+f x) (\cos (f x)+i \sin (f x))^3 \left ((A+5 i B) \cos (2 f x) (6 i \cos (e)-6 \sin (e))+3 (-i A+3 B) \cos (4 f x) (\cos (e)-i \sin (e))+6 (-i A+7 B) \log (\cos (e+f x)) \left (\cos \left (\frac {3 e}{2}\right )+i \sin \left (\frac {3 e}{2}\right )\right )^2-6 (A+7 i B) f x (\cos (3 e)+i \sin (3 e))+2 (A+i B) \cos (6 f x) (i \cos (3 e)+\sin (3 e))+6 i B \sec (e) \sec (e+f x) (\cos (3 e)+i \sin (3 e)) \sin (f x)+6 (A+5 i B) (\cos (e)+i \sin (e)) \sin (2 f x)+(A+3 i B) (-3 \cos (e)+3 i \sin (e)) \sin (4 f x)+2 (A+i B) (\cos (3 e)-i \sin (3 e)) \sin (6 f x)\right ) (A+B \tan (e+f x))}{6 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 104, normalized size = 0.63
method | result | size |
derivativedivides | \(\frac {c^{4} \left (i B \tan \left (f x +e \right )-\frac {8 i B +8 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {-18 i B -6 A}{-i+\tan \left (f x +e \right )}+\left (i A -7 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-12 i A +20 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(104\) |
default | \(\frac {c^{4} \left (i B \tan \left (f x +e \right )-\frac {8 i B +8 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {-18 i B -6 A}{-i+\tan \left (f x +e \right )}+\left (i A -7 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-12 i A +20 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,a^{3}}\) | \(104\) |
risch | \(-\frac {5 c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a^{3} f}+\frac {i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a^{3} f}+\frac {3 c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} B}{2 a^{3} f}-\frac {i c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} A}{2 a^{3} f}-\frac {c^{4} {\mathrm e}^{-6 i \left (f x +e \right )} B}{3 a^{3} f}+\frac {i c^{4} {\mathrm e}^{-6 i \left (f x +e \right )} A}{3 a^{3} f}-\frac {14 i c^{4} B x}{a^{3}}-\frac {2 c^{4} A x}{a^{3}}-\frac {14 i c^{4} B e}{a^{3} f}-\frac {2 c^{4} A e}{a^{3} f}-\frac {2 c^{4} B}{f \,a^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {7 c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{a^{3} f}-\frac {i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{a^{3} f}\) | \(253\) |
norman | \(\frac {\frac {\left (7 i c^{4} B +2 A \,c^{4}\right ) \tan \left (f x +e \right )}{a f}+\frac {i c^{4} B \left (\tan ^{7}\left (f x +e \right )\right )}{a f}-\frac {\left (7 i c^{4} B +A \,c^{4}\right ) x}{a}-\frac {-8 i c^{4} A +32 B \,c^{4}}{3 a f}-\frac {3 \left (7 i c^{4} B +A \,c^{4}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{a}-\frac {3 \left (7 i c^{4} B +A \,c^{4}\right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {\left (7 i c^{4} B +A \,c^{4}\right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{a}-\frac {\left (-49 i c^{4} B +8 A \,c^{4}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}+\frac {3 \left (7 i c^{4} B +2 A \,c^{4}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {\left (-4 i c^{4} A +28 B \,c^{4}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{a f}-\frac {\left (-12 i c^{4} A +28 B \,c^{4}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{a f}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {\left (-i c^{4} A +7 B \,c^{4}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a^{3} f}\) | \(342\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 5.03, size = 206, normalized size = 1.26 \begin {gather*} -\frac {12 \, {\left (A + 7 i \, B\right )} c^{4} f x e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, {\left (-i \, A + 7 \, B\right )} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} - {\left (-i \, A + 7 \, B\right )} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, {\left (-i \, A + B\right )} c^{4} + 6 \, {\left (2 \, {\left (A + 7 i \, B\right )} c^{4} f x + {\left (-i \, A + 7 \, B\right )} c^{4}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, {\left ({\left (i \, A - 7 \, B\right )} c^{4} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (i \, A - 7 \, B\right )} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{6 \, {\left (a^{3} f e^{\left (8 i \, f x + 8 i \, e\right )} + a^{3} f e^{\left (6 i \, f x + 6 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.75, size = 403, normalized size = 2.46 \begin {gather*} - \frac {2 B c^{4}}{a^{3} f e^{2 i e} e^{2 i f x} + a^{3} f} + \begin {cases} \frac {\left (\left (2 i A a^{6} c^{4} f^{2} e^{6 i e} - 2 B a^{6} c^{4} f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (- 3 i A a^{6} c^{4} f^{2} e^{8 i e} + 9 B a^{6} c^{4} f^{2} e^{8 i e}\right ) e^{- 4 i f x} + \left (6 i A a^{6} c^{4} f^{2} e^{10 i e} - 30 B a^{6} c^{4} f^{2} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{6 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (- \frac {- 2 A c^{4} - 14 i B c^{4}}{a^{3}} + \frac {\left (- 2 A c^{4} e^{6 i e} + 2 A c^{4} e^{4 i e} - 2 A c^{4} e^{2 i e} + 2 A c^{4} - 14 i B c^{4} e^{6 i e} + 10 i B c^{4} e^{4 i e} - 6 i B c^{4} e^{2 i e} + 2 i B c^{4}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} - \frac {i c^{4} \left (A + 7 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \frac {x \left (- 2 A c^{4} - 14 i B c^{4}\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 429 vs. \(2 (143) = 286\).
time = 1.09, size = 429, normalized size = 2.62 \begin {gather*} \frac {\frac {30 \, {\left (-i \, A c^{4} + 7 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} + \frac {60 \, {\left (i \, A c^{4} - 7 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} - \frac {30 \, {\left (i \, A c^{4} - 7 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} - \frac {30 \, {\left (-i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 7 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i \, A c^{4} - 7 \, B c^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a^{3}} - \frac {147 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 1029 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 1002 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 6534 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 17115 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 3820 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 23860 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 17115 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1002 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 6534 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 i \, A c^{4} + 1029 \, B c^{4}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.01, size = 266, normalized size = 1.62 \begin {gather*} -\frac {c^4\,\left (25\,B\,\mathrm {tan}\left (e+f\,x\right )-\frac {B\,32{}\mathrm {i}}{3}-A\,\mathrm {tan}\left (e+f\,x\right )\,6{}\mathrm {i}-\frac {8\,A}{3}-A\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )-B\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,7{}\mathrm {i}+6\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,15{}\mathrm {i}+3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3+B\,{\mathrm {tan}\left (e+f\,x\right )}^4\,1{}\mathrm {i}+3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )+A\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,21{}\mathrm {i}-7\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )-A\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,3{}\mathrm {i}+21\,B\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\right )\,1{}\mathrm {i}}{a^3\,f\,{\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________